package com.test;

import ij.process.ColorProcessor;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

import javax.imageio.ImageIO;

import de.lmu.ifi.dbs.jfeaturelib.features.CEDD;
import de.lmu.ifi.dbs.jfeaturelib.features.Gabor;
import de.lmu.ifi.dbs.jfeaturelib.features.LocalBinaryPatterns;


/**
 * This is is a very basic Class that demonstrates the usage of a descriptor
 * with plain Java without the commandline exctractor.
 *
 * @author Franz
 */
public class HaralickDemo {

    public static void main(String[] args) throws IOException, URISyntaxException {
        // load the image
        File f = new File("C:\\Users\\Ken\\Desktop\\data-mcr\\Images\\1_1_s.bmp");
//        ColorProcessor image = new ColorProcessor(ImageIO.read(f));
        
        BufferedImage img = ImageIO.read(f); 
        System.out.println("Size: " + img.getWidth() + "//" + img.getHeight());
        // List Region
        ColorProcessor image = new ColorProcessor(img);
//        LibProperties.get().setProperty(LibProperties.CEDD_COMPACT, 16);
        Gabor descriptor = new Gabor();
        descriptor.run(image);
        List<double[]> features = descriptor.getFeatures();
        System.out.println("Feature Size: "+ features.size()+"//" + features.get(0).length);
//        for (double[] feature : features) {
//			System.out.println(Arrays2.join(feature, ", ", "%.5f"));
//		}
		
        
    }
}
